<template>
  <div class="app-container">
    <!-- 后台管理-日志 -->
    <el-alert title="共100条记录" type="info" show-icon :closable="false"></el-alert>
    <el-table :data="list" style="width: 100%" v-loading="loading">
      <el-table-column prop="lable1" label="操作类型" width="180"></el-table-column>
      <el-table-column prop="lable2" label="操作人" width="180"></el-table-column>
      <el-table-column prop="lable3" label="执行结果" width="300"></el-table-column>
      <el-table-column prop="lable4" label="操作时间" width="180"></el-table-column>
      <el-table-column prop="lable5" label="描述" width="180"></el-table-column>
    </el-table>
    <!-- 分页器 -->
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="form.page"
      :page-sizes="[3, 5, 10, 15]"
      :page-size="form.pagesize"
      layout="total, prev, pager, sizes, next, jumper"
      :total="total">
    </el-pagination>
  </div>
</template>
<script>
export default {
  name: 'Logs',
  data() {
    return {
      list: [],
      loading: false,
      total: 0,
      form: {
        // 当前页
        page: 1,
        // 每页条数
        pagesize: 10,
      }
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    // 获取表格数据
    getList() {
      this.loading = true
      setTimeout(() => {
        this.list = [
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
          {lable1: '1111', lable2: '2222',  lable3: '36666',lable4: '49999', lable5: '5880' },
        ]
      this.total = this.list.length
      this.loading = false
      }, 800)
    },
    // 每页条数改变
    handleSizeChange(size) {
      this.form.pagesize = size
      this.getList()
    },
    // 当前页改变
    handleCurrentChange(page) {
      this.form.page = page
      this.getList()
    }
  }
}
</script>

<style>
  .app-container {
    margin: 10px;
    background-color: #fff;
  }
</style>